/**
 * Created by yangfan on 2016/10/12.
 */
define(['config/appregister',
    "i18n",
    "business/services/personCenterComp",
    "business/services/detailNavComp",
    "business/services/filter"],function(app,i18n){
    app.controller('personMineCtrl', function($scope,$state,$rootScope,auth) {
        auth.isPersonLogin();
        $scope.i18n = i18n;
        $scope.leftNav = [
            {title:"我的上传",state:"prosonMine.myUpload"},
            {title:"我的下载",state:"prosonMine.myDownload"},
            {title:"我的课程",state:"prosonMine.myVedios"},
            {title:"我的问答",state:"prosonMine.myQuestions"},
            {title:"我的评论",state:"prosonMine.myComment"},
            {title:"我的收藏",state:"prosonMine.myCollection"},
            {title:"我的好友",state:"prosonMine.myFriends",type:'fansEachother'},
            {title:"我的消息",state:"prosonMine.myMessage"}
        ];
     //   $state.go("prosonMine.myUpload");
        $scope.currentItem = [];
        $scope.changeView = function(item){
            if(typeof item.state=="string" &&item.state!=""){
                if(!angular.isUndefined(item.type)){
                    $state.go(item.state,{type:item.type});
                }else{
                    $state.go(item.state);
                }
            }
        };
        $scope.jumpToState = function(state){
            if(!state){
                return
            }
            if(state == 'myMainPage'){
                $state.go(state,{userId:$rootScope.userLoginInfo.data.userId});
            }else{
                $state.go(state);
            }
        };

    })
});